/*
c++向文件中写入对象
*/
#include <iostream>
#include <fstream>
#include <string>

class Student
{
public:
    Student(string name, int num, string address) : name(name), num(num), address(address) {}
    int getNum()
    {
        return this->num;
    }
    string getName()
    {
        return this->name;
    }
    string address()
    {
        return this->address;
    }
private:
    string name;
    int num;
    string address;
}

int main()
{
    string path(".\\2.data");
    std::fstream fs();
    fs.open(path,std::ios::in|std::ios::binary|std::ios::trunc);
    while (fs<<"abc")
    {
        
    }
    
}